#ifndef __MYSQL_CONN_POOL_H__
#define __MYSQL_CONN_POOL_H__

#include <list>
#include "mysql.h"
#include "singleton.h"
#include "mysql_conn.h"

class CMysqlConnPool :public singleton<CMysqlConnPool>
{
public:
	CMysqlConnPool();
	~CMysqlConnPool();

	void InitPool(char* url, char* user, char* password, char* dbname, unsigned int port);

	CMysqlConn* GetAvilibleConn();
	void BacktoPool(CMysqlConn* conn);

private:
	std::list<CMysqlConn*> m_IdleConnPool;
	//std::list<CMysqlConn*> m_BuzyConnPool;
};


#endif //__MYSQL_CONN_POOL_H__